package com.cancan.resultreturn.controller;

import com.cancan.resultreturn.result1.CommonResponse;
import com.cancan.resultreturn.result1.base.BaseController;
import com.cancan.resultreturn.result1.base.CommonController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: cancan-java-share
 * @description: 返回结果demo1
 * @author: cancan
 * @date: 2022-11-23 11:06:19
 */
@RestController
public class Result1Controller extends CommonController {
    @GetMapping("/test1")
    public CommonResponse<String> test() {
        //{"data":null,"code":"200","message":"成功","traceId":"HnOAcaKY","timeStamp":1669174005511}
        return responseSuccess();
    }

    @GetMapping("/test2")
    public CommonResponse<?> test2() {
        List<String> arrayList = new ArrayList<>();
        arrayList.add("测试");
        return responseSuccess(arrayList);
    }
}
